package com.atguigu.srb.core.controller.admin;


import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.entity.Lend;
import com.atguigu.srb.core.service.LendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 标的准备表 前端控制器
 * </p>
 *
 * @author gcq
 * @since 2021-04-11
 */
@Api(tags = "标的管理")
@RestController
@RequestMapping("/admin/core/lend")
public class AdminLendController {

    @Autowired
    LendService lendService;

    @ApiOperation("标的列表")
    @GetMapping("/list")
    public R list()
    {
        List<Lend> list = lendService.selectList();
        return R.ok().data("list", list);
    }

    @GetMapping("/show/{id}")
    public R show(@ApiParam(value = "标的Id") @PathVariable("id") Long id)
    {
        Map<String,Object> map = lendService.getDetailById(id);
        return R.ok().data("lendDetail", map);
    }
}

